#!/bin/bash

# AESB测试API启动脚本

echo "正在启动AESB测试API..."

# 检查Java环境
if ! command -v java &> /dev/null; then
    echo "错误: 未找到Java环境，请先安装JDK 8+"
    exit 1
fi

# 检查Maven环境
if ! command -v mvn &> /dev/null; then
    echo "错误: 未找到Maven环境，请先安装Maven 3.6+"
    exit 1
fi

# 编译项目
echo "正在编译项目..."
mvn clean compile

if [ $? -ne 0 ]; then
    echo "编译失败，请检查项目配置"
    exit 1
fi

# 启动应用
echo "正在启动应用..."
mvn spring-boot:run

echo "应用已启动，访问地址: http://localhost:33011"
echo "健康检查: http://localhost:33011/api/test/health" 